//
//  GZIM.m
//  Gunz
//
//  Created by Joggy on 16/3/9.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "GZIM.h"
#import <RongIMKit/RongIMKit.h>

static NSString *token = @"";

@implementation GZIM

+(void)initRongCloudIM {
    [[RCIM sharedRCIM] initWithAppKey:[self getAppKey]];
    [[RCIM sharedRCIM] connectWithToken:[self getToken] success:^(NSString *userId) {
        NSLog(@"登陆成功,用户ID为:%@", userId);
        RCUserInfo *currentInfo = [[RCUserInfo alloc] initWithUserId:@"2455" name:@"niuxiyuan" portrait:nil];
        [RCIMClient sharedRCIMClient].currentUserInfo = currentInfo;
    } error:^(RCConnectErrorCode status) {
        NSLog(@"登陆失败,状态为:%ld", (long)status);
    } tokenIncorrect:^{
        NSLog(@"token错误");
    }];
}

+(NSString*)getAppKey {
    return @"8brlm7ufrnuw3";
}

+(NSString*)getAppSecret {
    return @"ebFcaUD54aIl";
}

+(NSString*)getToken {
    return @"1tlDnAlwPhGrxSK8J9sW7sVLADH8rZMNGMvaKiPT2dl+bC2wR+utQ7/O4qLMLX5QrgxZjGYIVB15D7zjgg+kiQ==";
}

+(NSString*)token {
    token = @"1tlDnAlwPhGrxSK8J9sW7sVLADH8rZMNGMvaKiPT2dl+bC2wR+utQ7/O4qLMLX5QrgxZjGYIVB15D7zjgg+kiQ==";
    return token;
}

@end
